import {
  ChangeDetectionStrategy,
  Component,
  EventEmitter,
  Input,
  OnInit,
  Output,
} from '@angular/core';

@Component({
  selector: 'app-task-header',
  templateUrl: './task-header.component.html',
  styleUrls: ['./task-header.component.scss'],
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class TaskHeaderComponent implements OnInit {
  @Input() header = '';
  @Output() newTask = new EventEmitter<void>();
  @Output() moveAll = new EventEmitter<void>();
  @Output() delList = new EventEmitter<void>();
  @Output() changeListName = new EventEmitter<void>();

  constructor() {}

  ngOnInit(): void {}

  onNewTaskClick(): void {
    this.newTask.emit();
  }

  onMoveAllClick(): void {
    this.moveAll.emit();
  }

  onDelListClick(): void {
    this.delList.emit();
  }

  onEditListClick(): void {
    this.changeListName.emit();
  }
}
